home *** CD-ROM | disk | FTP | other *** search
- ;-------T-------T------------------------T----------------------------------;
- ;AGA Fade
- ;--------
- ;Fades in a 32 colour AGA picture (24 bit colour). Then up to a specified
- ;colour (greenish yellow), and then out to black.
- ;
- ;Press left mouse button to exit.
-
- INCDIR "INCLUDES:"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "AGAFade",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- STARTGMS
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l GMSBase(pc),a6
- lea PictureTags(pc),a1
- CALL LoadPic
- tst.l d0
- beq.s .Error_Picture
-
- move.l Picture(pc),a1
- lea ScreenTags(pc),a0
- move.l PIC_Data(a1),GMem
- CALL ShowScreen
- tst.l d0
- beq.s .Error_Screen
-
- bsr.s Main
-
- .ReturnToDOS
- move.l GMSBase(pc),a6
- move.l Picture(pc),a1
- CALL FreePic
- .Error_Picture
- move.l Screen(pc),a0
- CALL DeleteScreen
- .Error_Screen
- MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #ERR_OK,d0
- rts
-
- ;===========================================================================;
- ; MAIN CODE
- ;===========================================================================;
-
- Main: move.l Screen(pc),a0 ;a0 = GameScreen
- moveq #$00,d0 ;d0 = FadeState
- moveq #5,d1 ;d1 = Speed of fade.
- move.l Picture(pc),a1 ;a1 = Picture structure.
- move.l PIC_Palette(a1),a1 ;a1 = Palette to fade to.
- moveq #$000000,d2 ;d2 = Fading from black.
- moveq #00,d3 ;d3 = Start colour.
- move.l GS_AmtColours(a0),d4 ;d4 = Amount of colours.
- .f_in CALL WaitVBL
- CALL ColourToPalette ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s .f_in ;If not, keep doing it.
-
- moveq #2,d1 ;d1 = Speed of fade.
- move.l Picture(pc),a1 ;a1 = Picture structure.
- move.l PIC_Palette(a1),a1 ;a1 = Palette we are fading from.
- move.l #$75F343,d2 ;d2 = Colour we are fading to.
- .f_mid CALL WaitVBL
- CALL PaletteToColour ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s .f_mid ;If not, keep doing it.
-
- moveq #2,d1 ;d1 = Speed of fade.
- move.l #$a5F343,d2 ;d2 = Colour.
- moveq #$000000,d5 ;d5 = Colour.
- .f_out CALL WaitVBL
- CALL ColourMorph ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s .f_out ;If not, keep doing it.
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- ScreenTags:
- dc.l TAGS_GAMESCREEN
- Screen: dc.l 0
- dc.l GSA_MemPtr1
- GMem: dc.l 0
- dc.l GSA_AmtColours,32
- dc.l GSA_ScrWidth,320
- dc.l GSA_ScrHeight,256
- dc.l TAGEND
-
- PictureTags:
- dc.l TAGS_PICTURE
- Picture dc.l 0
- dc.l PCA_Width,320
- dc.l PCA_Height,256
- dc.l PCA_AmtColours,32
- dc.l PCA_Options,GETPALETTE|VIDEOMEM
- dc.l PCA_File,.file
- dc.l TAGEND
-
- .file dc.b "GMS:demos/data/PIC.Loading",0
- even
-
-
-